import requests

url = 'https://img1.baidu.com/it/u=1163772562,632865252&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=1084'
response = requests.get(url)

# 将获取到的静态文件下载到本地
# 1、获取图片文件二进制数据
img_content = response.content

# 2、将二进制文件下载到本地
with open('test_img.jpg', 'wb') as f:
    f.write(img_content)


